<script>
import * as echarts from 'echarts';
import data from "@/views/system/dict/data.vue";

export default {
  name: "index",
  data() {
    return {
      dataList: [],
      allNum:0,
      list:[]
    }
  },
  created() {
  },
  mounted() {
    let chartDom = document.getElementById('main');
    let myChart = echarts.init(chartDom);
    let option;
    option = {
      title: {
        text: '仓库类型',
        // subtext: 'Fake Data',
        left: 'left'
      },
      tooltip: {
        trigger: 'item'
      },
      legend: {
        orient: 'horizontal',
        // bottom: 'auto',
        top: 'bottom',
      },
      series: [
        {
          name: '跟进表',
          type: 'pie',
          radius: '50%',
          data: [
            {value: 1048, name: '原料仓库'},
            {value: 735, name: '成品仓库'},
            {value: 580, name: '半成品仓库'},
            {value: 484, name: '危险品仓库'},
            {value: 300, name: '普通仓库'}
          ],
          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: 'rgba(0, 0, 0, 0.5)'
            }
          }
        }
      ]
    }
    option && myChart.setOption(option);

    option.series.forEach(el => {
      this.list.push(el.data)
    })
  },
};
</script>

<template>
  <div class="box">
    <div id="main" style="width: 80vw;height: 50vh"></div>
  </div>
</template>

<style scoped lang="scss">
.box {
  margin: 0 auto;
  padding: 20px;
}
</style>
